<div class="sys-title">
    <h2>设备列表</h2>
</div>

<div class="sys-content">

    <div class="panel">
        <div class="panel-head">
            <div class="panel-title">
                <h3>设备列表</h3>
            </div>

            <div class="btnbar">
                <button class="btn btn-success" id="add">添加设备</button>
            </div>

            <div class="filter">
                <select id="deviceType">
                    <option value="-1">设备类型</option>
                    <option>探针设备</option>
                    <option>脱敏设备</option>
                    <option>运维设备</option>
                </select>
                <select id="deviceState">
                    <option value="-1">设备状态</option>
                    <option value="0">离线</option>
                    <option value="1">故障</option>
                    <option value="2">正常</option>
                </select>
                <div class="fm-group"><select id="deviceName">
                    <option>设备名称</option>
                    <option>设备编号</option>
                    <option>设备位置</option>
                    <option>管理员</option>
                </select>
                    <input type="text" id="deviceText" placeholder="请输入关键词查询">
                </div>
                <button class="btn" id="deviceSearch">检索</button>
            </div>

        </div>
        <div class="panel-body">
            <table class="table table-striped">
                <thead>
                <tr>
                    <th width="3%"><input id="checkAll" type="checkbox"></th>
                    <th >设备编号</th>
                    <th>设备名称</th>
                    <th>设备类型</th>
                    <th>IP地址</th>
                    <th>MAC地址</th>
                    <th>位置</th>
                    <th>管理员</th>
                    <th>联系电话</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="devicePageList">

                </tbody>
            </table>


            <div class="footbar">
                <div class="btns">
                    <button class="btn btn-danger" id="delAll">批量删除</button>
                    <!--<button class="btn btn-minor" id="startAll">批量重启</button>
                    <button class="btn btn-minor" id="closeAll">批量关闭</button>-->
                </div>
                <div class="page" id="pageList">
                </div>
            </div>

        </div>

    </div>
</div>

<div class="dialog">
    <div class="dialog-win">
        <div class="dialog-head"><span>添加设备</span><a class="close" href="javascript:void(0)"><i class="icon-close"></i></a></div>
        <div class="dialog-body">

            <div class="form-box" style="display:block;">
                <div class="form-item">
                    <div class="form-title"><!-- <em class="fc-danger">*</em> -->设备类型：</div>
                    <div class="form-content">
                        <select id="addDeviceType">
                            <option value="-1">请选择</option>
                        </select>
                    </div>
                </div>
                <div class="form-item">
                    <div class="form-title"><!-- <em class="fc-danger">*</em> -->设备产商：</div>
                    <div class="form-content">
                        <select id="addDeviceVender">
                            <option value="-1">请选择</option>
                        </select>
                    </div>
                </div>

                <div class="form-item">
                    <div class="form-title">设备版本：</div>
                    <div class="form-content"><input class="input" name="version" id="addDeviceVersion" value="" type="text"></div>
                </div>
                <div class="form-item">
                    <div class="form-title">设备名称：</div>
                    <div class="form-content"><input class="input" name="name" id="addDeviceName" value="" type="text"></div>
                </div>
                <div class="form-item">
                    <div class="form-title">IP地址：</div>
                    <div class="form-content"><input class="input" name="ip" id="addDeviceIp" value="" type="text"></div>
                </div>
                <div class="form-item">
                    <div class="form-title">MAC地址：</div>
                    <div class="form-content"><input class="input" name="mac" id="addDeviceMac" value="" type="text"></div>
                </div>

                <div class="form-item">
                    <div class="form-title">位置：</div>
                    <div class="form-content"><input class="input" name="location" value="" id="addDeviceLocat" type="text"></div>
                </div>

                <div class="form-item">
                    <div class="form-title">登录用户名：</div>
                    <div class="form-content"><input class="input" name="userName" value="" id="userName" type="text"></div>
                </div>
                <div class="form-item">
                    <div class="form-title">登录密码：</div>
                    <div class="form-content"><input class="input" name="userPassword" id="userPassword" type="password"></div>
                </div>

                <div class="form-item">
                    <div class="form-title">管理员：</div>
                    <div class="form-content"><input class="input" name="admin" id="deviceaDminName" value="" type="text"></div>
                </div>
                <div class="form-item">
                    <div class="form-title">联系方式：</div>
                    <div class="form-content"><input class="input" name="phone" id="devicePhone" type="text"></div>
                </div>

                <div class="form-item form-btn">
                    <button class="btn" id="save">确认</button>
                    <button class="btn btn-minor" id="default">取消</button>
                </div>
            </div>

        </div>
    </div>
</div>
<!--dialog end-->
<script type="text/javascript">
    $(document).ready(function () {
        $("#add").on("click", function () {
            $('.R1').remove()
            $('#userName').attr('disabled',false)
            $('#userPassword').attr('disabled',false)
            $('.dialog-head span').html('添加设备')
            $('#addDeviceName').val('')
            $('#addDeviceIp').val('')
            $('#addDeviceMac').val('')
            $('#addDeviceType').val('-1')
            $('#addDeviceLocat').val('')
            $('#deviceaDminName').val('')
            $('#devicePhone').val('')
            $('#userName').val('')
            $('#userPassword').val('')
            $(".dialog").show()
        })

        $(".dialog").on("click", ".close", function () {
            $('.R1').remove()
            $(".dialog").hide()
        })

        $('.form-item input').validata()
    })
</script>

<script src="./scripts/app/safe/homePage/deviceList.js"></script>